home *** CD-ROM | disk | FTP | other *** search
- \space 20
- \CENTER on
- TPRINT PROGRAM DOCUMENTATION
-
- (and test file)
- \space 20
-
- \CENTER off
-
- Howard Richoux
- 6721 Shamrock Rd.
- Lincoln, NE 68506-2821
- (402) 488-5867
- \new
-
- \CENTER TPRINT 3.00
- \join on
-
- This program is an old-fashioned, command based text
- processor. Formatting commands are placed in the clear in the
- text file, rather than hidden as invisible character sequences.
- One of the benefits is that you can see exactly what formatting is
- going to be done. Also, it is pretty easy to generate some of these
- commands programatically, in report programs, and use the output for
- multiple purposes.
-
- \join off
- Commands:
- \indent 10
- OFFSET n - left margin for everything ( 0 - 20 )
- INDENT n - Sets an additional offset for text ( 0 - 20 )
- CENTER ON/OFF - Centers all lines from ON to OFF
- CENTER text - Centers this text
- SPACE n - Writes n blank lines
- NEW - Goes to new page
- TRIGGER n - n is the decimal equivalent of an ASCII char
- default is backslash (92)
- \indent 0
-
- Headers and Footers:
- \indent 10
- HEADERn 'spec' - Sets a new header specification (details later)
- FOOTERn 'spec' - Sets a new footer specification (details later)
- \indent 0
-
- Special Commands: (Debugging)
- \indent 10
- DEBUG ON/OFF - Sets a flag for program to print intermediate steps
- ECHO ON/OFF - Echoes the TPRINT commands encountered
- \indent 0
- \join on
-
- These are typically set in a TPRINT.CFG file. There are (optionally)
- two of these files. The first resides on the same directory as the
- TPRINT.EXE file. This would be used to hold general defaults, which
- will apply to all uses of the program. These can be overridden by a
- TPRINT.CFG on the current directory. Even these can be overridden by
- placing the same thing on the command line following the file name. This
- same nested configuration file applies to most utilities I write. It
- costs 5-10k in code size, but the added flexibility is extremely useful.
- Because of the way it is implemented, you could duplicate TPRINT.exe as
- TPRINT2.exe(or xyz.exe), change parameters in the TPRINT2.cfg files and have
- a very different program.
- \join off
-
- \HEADER1 '@LABEL1|@FILE|Page @PAGE'
- \NEW
- \CENTER TPRINT Box Commands
- This is a reasonable, though not too elegant, method of adding
- line drawing commands to your text. The trigger character is the <tilde>
- ASCII 126. You use them like quote marks to bracket characters you want
- converted to line draw characters. Since TPRINT is printing this document,
- I will replace the <tilde>s on this page with <hat>s (^).
-
- This:
- \INDENT 10
-
- This is a Box
-
- Everything ^L---------M-------R^ Mnemonics:
- outside ^| | |^ L = Upper Left
- the ^| | |^ M = Upper Middle
- squiggles ^| | |^ R = Upper Right
- is normal ^S---------+-------s^ S = Left Side
- text. ^| | |^ + = center
- ^| | |^ s = right side
- ^| | |^ l = lower left
- ^l---------m-------r^ m = lover middle
- r = lower right
- ^1222222222222222223^
-
-
- \INDENT 0
-
- Becomes:
-
- \INDENT 10
- This is a Box
-
- Everything ~L---------M-------R~ Mnemonics:
- outside ~| | |~ L = Upper Left
- the ~| | |~ M = Upper Middle
- squiggles ~| | |~ R = Upper Right
- is normal ~S---------+-------s~ S = Left Side
- text. ~| | |~ + = center
- ~| | |~ s = right side
- ~| | |~ l = lower left
- ~l---------m-------r~ m = lover middle
- r = lower right
- ~1222222222222222223~
-
-
- \INDENT 0
-
- \HEADER1 '@LABEL1|Quoted Strings Section|Page @PAGE'
- \NEW
- \CENTER TPRINT Headers and Footers
-
- With any kind of luck, the header at the top of the page had
- the center portion replaced. The specification for the top page header
- was:
- HEADER1 '@LABEL1|Quoted Strings Section|Page @PAGE'
-
- Pages are laid out as follows:
- Default Specification
- HEADER1 '@LABEL1|@FILE|'
- HEADER2 ' '
- HEADER3 ''
- <text>
- FOOTER2 ''
- FOOTER1 '||Page @PAGE'
-
- A specification is of the form: '<spec>|<spec>|<spec3>' where
- the specs define the left, center and right portions respectively. The
- left section is left justified, the right section is right justified, and
- the center section is centered, the '|' are invisible. These vary by the
- defined page width.
-
- The currently defined elements for headers and footers are as
- follows:
- \JOIN OFF
- \INDENT 10
-
- @DATE - current date as mm/dd/yy
- @TIME - current time as hh:mm
- @DTIME - date and time as mm/dd/yy hh:mm
- @PAGE - current page number
- @PROGID - program ID of program making listing
- @FILE - current file being operated on
- @LABEL1 - TPRINT defines as datetime of current file
- @LABEL2 - undefined - set with param
- @LABEL3 - undefined - set with param
- Anything else is treated as literal characters and printed in the
- appropriate place.
-
- \INDENT 0
- \JOIN ON
- This group of variables is not random and is implemented in the
- list_object level 1. Any program using the level 1 list_object can use these.
- It is simple to add other variables, but since this is a rather low level
- in the program, code added to the list object will propagate to most other
- programs using the object. The DOS unit code added to the list_object was the
- reason that the @FDATE variable (date time of current file) was removed from
- the list_object and added to the TPRINT program. Similarly, the list_object was
- divided into 2 levels to save about 5k of code for programs not needing headers,
- footers, word-wrap and the like. Both levels provide the basic interchangeability
- between console, printer and text file.
-
- \HEADER1 '@LABEL1|@FILE|'
- \HEADER2 ' '
- \NEW
-
- The JOIN command initiates a word-wrap function until turned off.
- this ignores the end of lines in the source text, and wraps the text at
- blank spaces in the words.
-
- This isn't perfect, but allows some page formatting.
- Blocks are terminated at a blank line. Here is the same text re-done with
- a JOIN 40 (and an INDENT 10) to make a 40 char wide column.
-
- \INDENT 10
- \JOIN 40
- The JOIN command initiates a word-wrap function until turned off.
- this ignores the end of lines in the source text, and wraps the text at
- blank spaces in the words.
-
- This isn't perfect, but allows some page formatting.
- Blocks are terminated at a blank line. Here is the same text re-done with
- a JOIN 40 to make a 40 char wide column.
-
- \JOIN OFF
- \INDENT 0
-
- \NEW
- \center Sourcing Other Text Files
-
- \JOIN 65
- \JOIN ON
- The SOURCE command allows a second level of files to be read and
- merged into a single document. At present, only 2 levels are allowed, so
- SOURCE commands in sourced in files are ignored. I intend to implement
- sourcing of file sections. A file section would be designated by a
- selectable trigger such as "\SECTION <name>" or "?sect <name>" and would end
- at the next section trigger.
-
- Here is source from another file (tprint1.doc):
-
- \source tprint1.doc
-
-
-
-
- \JOIN OFF
- \INDENT 0
- THE END